import QtQuick
import QtQuick.Window
import QtQuick.Controls 2.5

Item {
    id: root
    scale: 0.75
    anchors.fill: parent

    Rectangle {
        id: mask
        scale: 1 / 0.75
        anchors.fill: parent
        color: "black"
        opacity: 0.0
    }
    AnimatedImage{
           
            id: animation
            source:"skin2__caoxiancaohua.gif"
            width:500
            height:247
            anchors.centerIn:parent
            // 开启异步加载模式，专门使用一个线程来加载图片
            asynchronous: true
            // 图片较大的情况下,指定不缓存图像(cache默认为true)
            cache: false
            
           
    }
    Rectangle {
         property int frames: animation.frameCount
         property int gframes: animation.currentFrame

         width: 2; height: 2
         x: (animation.width - width) * animation.currentFrame / frames
         y: animation.height
         color: "red"
        onGframesChanged: {
               if (animation.currentFrame===animation.frameCount){
                animation.playing=false
                roomScene.bigAnim.source = "";
               }
               else if(animation.currentFrame===animation.frameCount-1){
                animation.playing=false
                roomScene.bigAnim.source = "";
                }
        }
         
    }
 

}

